<script type="text/javascript" src="<?php echo js_link("order.js","admin");?>"></script>
<script type="text/javascript" src="<?php echo js_link("calendarDateInput.js","admin");?>"></script>
<?php echo $this->message->display();?>
<h1>Edit order</h1>
 <form action="<?php echo admin_url('customer/my_order_edit?order_id='.$order['session_id'])?>" method="post">
<div class="editcate_ct" id="content">
		<div class="boxadd">
		    <ul class="linect">
		    	<li>
		        	<span class="left"><b>Select tour:</b></span>
		        	<span class="right"><select name="tour_id">
		        	<?php foreach($tour_code as $code){?>
		        	<option value="<?php echo $code["id"];?>" <?php echo ($code['id'] == $order['tour_id']) ? "selected" : "";?>><?php echo $code["code"];?></option>
		        	<?php }?>
		        	</select></span>
		        </li>
		        <li>
		        	<span class="left"><b>Select customer:</b></span>
		        	<span class="right"><select name="customer_id">
		        	<?php foreach($customer as $cus){?>
		        	<option value="<?php echo $cus["id"];?>" <?php echo ($cus['id'] == $order['customer_id']) ? "selected" : "";?>><?php echo $cus["fullname"];?></option>
		        	<?php }?>
		        	</select></span>
		        </li>
		        <li>
		        	<span class="left"><b>Date departure:</b></span>
		        	<span class="right"><script>DateInput('date_departure', true, 'YYYY-MON-DD', '<?php echo $order['date_departure'];?>')</script></span>
		        </li>
		        <li>
		        	<span class="left"><b>End date:</b></span>
		        	<span class="right"><script>DateInput('end_date', true, 'YYYY-MON-DD', '<?php echo $order['end_date'];?>')</script></span>
		        </li>
		        <li>
		        	<span class="left"><b>Num persons:</b></span>
		        	<span class="right"><input type="text" name="num_persons" value="<?php echo $order['num_persons'];?>" /></span>
		        </li>
		        <li>
		        	<span class="left"><b>Adults:</b></span>
		        	<span class="right"><select name="num_adult">
		        	<?php for($i=1; $i<=20; $i++){?>
		        	<option value="<?php echo $i;?>" <?php echo ($i==$order['num_adult']) ? "selected" : "";?>><?php echo $i;?></option>
		        	<?php }?>
		        	</select>
		        	</span>
		        </li>
		        <li>
		        	<span class="left"><b>Children:</b></span>
		        	<span class="right"><select name="num_chil">
		        	<?php for($i=1; $i<=20; $i++){?>
		        	<option value="<?php echo $i;?>" <?php echo ($i==$order['num_chil']) ? "selected" : "";?>><?php echo $i;?></option>
		        	<?php }?>
		        	</select>
		        	</span>
		        </li>
		        <li>
		        	<span class="left"><b>Babies:</b></span>
		        	<span class="right"><select name="num_baby">
		        	<?php for($i=1; $i<=20; $i++){?>
		        	<option value="<?php echo $i;?>" <?php echo ($i==$order['num_baby']) ? "selected" : "";?>><?php echo $i;?></option>
		        	<?php }?>
		        	</select>
		        	</span>
		        </li>
		        <li>
		        	<span class="left"><b>Detail persons:</b></span>
		        	<span class="right"><input type="text" name="detail_persons" value="<?php echo $order['detail_persons'];?>" /></span>
		        </li>
		        
		        <li>
		        	<span class="left"><b>Total price:</b></span>
		        	<span class="right"><input type="text" name="total_price" value="<?php echo $order['total_price'];?>" /></span>
		        </li>
		        <li>
		        	<span class="left"><b>Num rooms:</b></span>
		        	<span class="right"><input type="text" name="num_rooms" value="<?php echo $order['num_rooms'];?>" /></span>
		        </li>
		        <li>
		        	<span class="left"><b>Room preferred:</b></span>
		        	<span class="right"><select name="room_preferred">
					<?php foreach($room_preferred as $room){?>
		        	<option value="<?php echo $room;?>" <?php echo ($room==$order['room_preferred']) ? "selected" : "";?>><?php echo $room;?></option>
		        	<?php }?>
					</select></span>
		        </li>
		        <li>
		        	<span class="left"><b>Hotel preferred:</b></span>
		        	<span class="right"><select name="hotel_preferred">
					<?php foreach($hotel_preferred as $hotel){?>
		        	<option value="<?php echo $hotel;?>" <?php echo ($hotel==$order['hotel_preferred']) ? "selected" : "";?>><?php echo $hotel;?></option>
		        	<?php }?>
					</select></span>
		        	<span class="right"></span>
		        </li>
		        <li>
		        	<span class="left"><b>Request for visa:</b></span>
		        	<span class="right"><input type="checkbox" name="request_for_visa" <?php echo ($order['request_for_visa']=='yes') ? "checked" : "";?> value="yes" /></span>
		        </li>
		        <li>
		        	<span class="left"><b>Request for hotel:</b></span>
		        	<span class="right"><input type="checkbox" name="request_hotel" <?php echo ($order['request_hotel']=='yes') ? "checked" : "";?> value="yes" /></span>
		        </li>
		        <li>
		        	<span class="left"><b>Flight number:</b></span>
		        	<span class="right"><input type="text" name="flight_number" value="<?php echo $order['flight_number'];?>" /></span>
		        </li>
		        <li>
		        	<span class="left"><b>Date arrival:</b></span>
		        	<span class="right"><script>DateInput('date_arrival', true, 'YYYY-MON-DD', '<?php echo $order['date_arrival'];?>')</script></span>
		        </li>
		        <li>
		        	<span class="left"><b>Time arrival:</b></span>
		        	<span class="right"><script>DateInput('time_arrival', true, 'YYYY-MON-DD', '<?php echo $order['date_arrival'];?>')</script></span>
		        </li>
		        <li>
		        	<span class="left"><b>Contact status:</b></span>
		        	<span class="right"><input type="checkbox" name="contact_status" value="done" <?php echo ($order['contact_status']=="done") ? "checked" : "";?> /></span>
		        </li>
		        <li>
		        	<span class="left"><b>Order infomation:</b></span>
		        	<span class="right"><textarea name="order_info" cols="50" rows="10"><?php echo $order['order_info'];?></textarea></span>
		        </li>
		        <li>
		        	<span class="left"><b>Pro code:</b></span>
		        	<span class="right"><input type="text" name="pro_code" value="<?php echo $order['pro_code'];?>" /></span>
		        </li>
		        <li>
		        	<span class="left"><b>Total pay:</b></span>
		        	<span class="right"><input type="text" name="total_pay" value="<?php echo $order['total_pay'];?>" /></span>
		        </li>
		        <li>
		        	<span class="left"><b>Guest name</b>:</span>
		        	<span class="right"><input type="text" name="guest_name" value="<?php echo $order['guest_name'];?>" /></span>
		        </li>
		        <li>
		        	<span class="left"><b>Time leave:</b></span>
		        	<span class="right"><script>DateInput('time_leave', true, 'YYYY-MON-DD', '<?php echo $order['time_leave'];?>')</script></span>
		        </li>
		        <li>
		        	<span class="left"><b>Pay status:</b></span>
		        	<span class="right"><select name="pay_stt">
		        	<?php foreach($pay_status as $pay_stt){?>
		        	<option value="<?php echo $pay_stt?>" <?php echo ($pay_stt==$order['pay_status']) ? "selected" : "";?>><?php echo $pay_stt?></option>
		        	<?php }?>
					</select></span>
		        </li>
		        <li>
		        	<span class="left"><b>Time pay:</b></span>
		        	<span class="right"><script>DateInput('time_pay', true, 'YYYY-MON-DD', '<?php echo $order['time_pay'];?>')</script></span>
		        </li>		        
	        </ul>   
		</div>
		<div class="btarticle">
	    	<input type="button" onclick="document.location.href=('<?php echo admin_url('customer/my_order')?>')" name="close" value="Cancel" class="btn" style="float:left;" />
	        <input type="submit" name="" value="Save & Exit" class="btn" style="float:left;" />
	    </div>
	</div>
</form>
